package com.jscm.openselect;

import com.jscm.showdata.TagMomeory;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.value.ObservableValue;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.scene.control.Label;
import javafx.scene.control.TableColumn;
import javafx.scene.control.TableView;
import javafx.util.Callback;

/**
 * 偏移列表
 */
public class SelectTableView {
    private static TableColumn<String,String> tableColumn0 = new TableColumn<>("偏移地址");
    public static ObservableList<String> observableList = FXCollections.observableArrayList();
    public static TableView<String> tableView = new TableView<String>(observableList);
    static {
        init();
    }

    private static void init() {
        tableView.setPrefWidth(385);
        tableView.setPrefHeight(200);
        tableColumn0.setPrefWidth(380);
        tableColumn0.setSortable(false);
//        tableColumn0.setStyle("-fx-background-color: #5f93e7;-fx-text-fill:#ffffff");
        tableView.setPlaceholder(new Label("暂未加载任何数据"));
        tableColumn0.setCellValueFactory(new Callback<TableColumn.CellDataFeatures<String, String>, ObservableValue<String>>() {
            @Override
            public ObservableValue<String> call(TableColumn.CellDataFeatures<String, String> param) {
                SimpleStringProperty simpleStringProperty = new SimpleStringProperty(param.getValue());
                return simpleStringProperty;
            }
        });
        tableView.getColumns().addAll(tableColumn0);
    }
}
